/**write a program to insert text file
 * 
 */

import java.sql.*;
import java.io.*;
class JdbcDemo25 
{
	public static void main(String args[]) throws Exception
	{
		Class.forName("oracle.jdbc.driver.OracleDriver");
		Connection cn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
		PreparedStatement ps = cn.prepareStatement("insert into textfile values(?,?)");
		ps.setString(1, "amit");
		File f = new File("2013crack.txt");
		FileReader fr = new FileReader(f);
		ps.setCharacterStream(2, fr, f.length());
		int count = ps.executeUpdate();
		System.out.println(count  +  "rows inserted");
		fr.close();
		cn.close();
		ps.close();
		
		
		
		//System.out.println(cn);
	}

}
